Rename DualSenseDriver → PlayStationDriver (re-targeting main)#4
Merged
Merged
Conversation
The class covers both DualSense (DS5) and DualShock 4 (DS4) USB protocols
plus their clones (GameSir Super Nova / Cyclone 2 in DS4 mode). Naming it
"DualSenseDriver" was misleading — DualSense is one specific physical
controller, not the protocol family — and users hit that confusion in
practice ("I have a DualSense, not a DualShock, why is the file/class
named like that?").
Pure rename, no behavior change:
- File: packages/core/src/drivers/{dualsense → playstation}-driver.js
(via git mv so history follows)
- Class: DualSenseDriver → PlayStationDriver
- Module header comment expanded to spell out which protocols it
covers and which clones spoof them.
Preserved on purpose:
- PROTOCOLS map key stays 'dualsense'. The visualizer's PROFILES
table uses 'dualsense' as its profile key, and entry.controllerProfile
defaults to entry.protocol → 'dualsense' for all Sony entries. Renaming
the protocol key would force a controllerProfile: 'dualsense' override
on every PlayStation entry just to keep the same GLB loading. Not
worth the churn for a cosmetic improvement. A comment in PROTOCOLS
explains the historical naming.
Touched files:
- packages/core/src/drivers/playstation-driver.js (renamed + class +
static method references DualSenseDriver._parseTouchPoint /
._crc32 updated)
- packages/core/src/devices.js (import + PROTOCOLS map entry)
- packages/core/src/index.js (barrel re-export)
- packages/core/src/drivers/controller-registry.js (one comment)
- packages/core/README.md (subpath-exports table)
- docs/ADDING-A-CONTROLLER.md (protocol-table row + the worked-example
code-link)
Co-Authored-By: Claude Opus 4.7 (1M context) <noreply@anthropic.com>
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Summary
Re-targets the rename to main. The original PR #2 was approved and merged, but its base was the
feat/device-dictionary-and-wizardbranch (the dictionary PR), not main. When PR #1 (dictionary) was merged to main first and PR #2 was merged into its (now stale) feature branch second, the rename ended up "stuck" on the feature branch and never reached main. Main still hasDualSenseDriver.This PR is a pure cherry-pick of the original rename commit (
44ee8dc) onto a branch off the current main. No new content; identical to PR #2 in scope.packages/core/src/drivers/dualsense-driver.js→playstation-driver.js(viagit mvso history follows)DualSenseDriver→PlayStationDriverdevices.js,index.js,controller-registry.js, core README, and the onboarding doc updatedPROTOCOLSmap key preserved as'dualsense'(with explanatory comment) so the visualizer'sPROFILES['dualsense']GLB continues to load for all Sony entries without forcing acontrollerProfileoverride on every PlayStation entryTest plan
node --input-type=module -e "import('@usersfirst/controller-core').then(m => console.log(Object.keys(m).filter(k => k.endsWith('Driver'))))"listsPlayStationDriver(notDualSenseDriver).m.PROTOCOLS[m.ControllerRegistry.getEntry(0x054c, 0x0ce6).protocol].namereturnsPlayStationDriver.🤖 Generated with Claude Code